﻿using System.Collections.Generic;

namespace MsTestUtilities.SolutionAnalysis.Testing
{
    public class ItemAssert<T> : CollectionAssertionBase<T>
        where T : IItem
    {
        public ItemAssert(IEnumerable<T> items)
            : base(items)
        {            
        }

        protected override string ElementName(T element)
        {
            return element.Include;
        }

        public void IsNotIn(IList<string> blacklistedReferences)
        {
            Satisfies(
                i => i.Include,
                include => !blacklistedReferences.Contains(include),
                f => string.Format(
                    "Project {0} contains unexpected reference to the DLL {0}.",
                    f.ParentProject.Name,
                    f.Include));
        }
    }
}
